1. Field of the Invention
The present invention relates to correction of defective pixels in digital images. More particularly, the present invention relates to methods for performing fast pixel correction in digital color images.
2. The Prior Art
There are numerous methods known in the prior art for replacing defective pixels in digital images. For example, in cameras employing the F13 sensor or its predecessors manufactured by Foveon, Inc., defective pixels are corrected using a defective pixel map or list generated during sensor calibration. In this step defective pixels are replaced with average values of the neighboring pixels that are not defective.
According to this prior-art method, defective pixels have been identified and are entered into a defective pixel map or list. All three color channels of each identified defective pixel get replaced by the average of a specified set of neighbors. An example of this algorithm can be seen from an examination of FIG. 1. In this figure, a 3×3 pixel neighborhood of a single color channel (e.g., red) is shown, with nine pixels in this neighborhood labeled as R1 to R9. For purposes of this example, it is assumed that pixels R1 and R5 are defective, as indicated by the “X” designations in the lower right-hand corners of those pixels. For correction of each pixel, a 3×3 neighborhood of pixels is selected wherein the center pixel is the pixel of interest. In the example of FIG. 1, pixel R5 is of interest.
In the pixel neighborhood where pixel R5 is the center, pixels R2, R3, R4, R6, R7, R8, and R9 are good and may be used in the illustrative prior-art correction algorithm. Pixel R1 is defective and will not be used to estimate the value of defective pixel R5. According to this prior-art algorithm, the average value of the good neighboring pixels is computed and is substituted for the value of the defective pixel R5. Thus, in the example shown in FIG. 1, the substitute value for pixel R5 may be computed as:R5=(R2+R3+R4+R6+R7+R8+R9)/7  (1)
In a more general sense, image data and the defective pixel list are used as the input to the algorithm. Each defective pixel on the list may be identified by its multi-bit address and followed by an 8-bit mask (0 or 1). This mask is to identify each of the eight surrounding pixels as a good (1) or defective (0) pixel. Only the good pixels are used to determine the replacement value. This operation can be mathematically written as follows:
                              y                                    (                              r                ,                s                            )                        ⁢            k                          =                  {                                                                                          1                                                                  ∑                                                                              (                                                          i                              ,                              j                                                        )                                                    ∈                          ζ                                                                    ⁢                                              b                                                  (                                                      i                            ,                            j                                                    )                                                                                                      ⁢                                                            ∑                                                                        (                                                      i                            ,                            j                                                    )                                                ∈                        ζ                                                              ⁢                                                                  b                                                  (                                                      i                            ,                            j                                                    )                                                                    ⁢                                              x                                                                              (                                                          i                              ,                              j                                                        )                                                    ⁢                          k                                                                                                                                                                                                            for                      ⁢                                                                                          ⁢                                              b                                                  (                                                      r                            ,                            s                                                    )                                                                                      =                    0                                    ,                                                                                                      x                                                            (                                              r                        ,                        s                                            )                                        ⁢                    k                                                                                                                    for                    ⁢                                                                                  ⁢                                          b                                              (                                                  r                          ,                          s                                                )                                                                              =                  1                                                                                        (        2        )            where k indicates the color channel, that is, k=1 for red, k=2 for green, and k=3 for blue. The triplet y(r,s)=[y(r,s)1, y(r,s)2, y(r,s)3]T denotes the corrected color pixel, wheres x(i,j)=[x(i,j)1,x(i,j)2,x(i,j)3]T, for (i,j)εζ, denotes the pixels from the input color image with defective pixels. Each component of these pixels represents the intensity value in the kth color channel. The term ζ={(i,j);r−1≦i≦r+1,s−1≦j≦s+1} denotes a 3×3 pixel neighborhood centered in the location (r,s) of the pixel to be corrected. The need for the correction process is indicated by the defective pixel flag b(r,s)=0. If the location (r,s) is associated with the defective pixel flag b(r,s)=1, then the pixel under consideration is kept unchanged.
This prior-art algorithm operates directly on pixel values and processes each color channel separately, ignoring the fact that natural color images usually exhibit significant spectral correlation. Unfortunately, such componentwise processing often results in various color shifts or visible edge artifacts due to the lack of color information in the data estimation process. To avoid this drawback, a different solution is needed.